﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using InformationSystem.BLL.Core.Model;

namespace InformationSystem.WebSite
{
    public partial class Logout : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //不需要次逻辑，
            //因为不限制用户只能在一处登陆
            //所以当前地点的注销，不能代表其他地方也会注销
            //在线用户的清理过程交由定时处理线程
            //LoginUser user = (LoginUser)Session["LoginUser"];
            //if (user != null)
            //{
            //    Application.Lock();
            //    List<LoginUser> userlist = (List<LoginUser>)Application[Common.OnLine];
            //    LoginUser lu = userlist.Find(var => var.UserID == user.UserID);
            //    if (lu != null)
            //    {
            //        userlist.Remove(lu);
            //    }
            //    Application.UnLock();

            //}
            Session["LoginUser"] = null;
            Response.Redirect("Login.aspx");
        }
    }
}